# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=alsa-lib
pkgver=1.2.10
pkgrel=0
pkgdesc="Advanced Linux Sound Architecture (ALSA) library"
url="https://alsa-project.org/"
arch="all"
license="LGPL-2.1-or-later"
subpackages="$pkgname-dbg $pkgname-dev"
makedepends="linux-headers"
source="https://alsa-project.org/files/pub/lib/alsa-lib-$pkgver.tar.bz2
	remove-test.patch
	fix-PATH_MAX-on-ppc64le.patch
	move-string-macro.patch
	ump-header-detection.patch
	fix-segfault-32bit.patch
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-python \
		--disable-static \
		--disable-resmgr \
		--enable-rawmidi \
		--enable-seq \
		--enable-aload \
		--disable-dependency-tracking \
		--without-versioned
	make
}

check() {
	make check
}

package() {
	make -j1 DESTDIR="$pkgdir" install
	install -d -m755 "$pkgdir"/etc/alsa/conf.d
}

sha512sums="
4ccbd1dc5a612044571c26290923009e4c3f7959b30a5d0bed47daa68bbefaff9059c4f0fa3bc16f22c1eed2d36f079139369f40243da5921ae4de02a4541939  alsa-lib-1.2.10.tar.bz2
e15318431fe2d5bd1e42ef793f223e3e5995890d7befe6daa3d7456ccf5cb2f51eb79171539cecae13032a9b8a798ea35e04c89b27c7ef9567e2c03fb8db4512  remove-test.patch
f980d153c2f179e2f8fd90180d19250e5a5e12388f31d86a233d89be72ae7e96b944a8f435f0a11c6140378ac38eaa937175e1c100395ec4f635a9a6a4b1ae25  fix-PATH_MAX-on-ppc64le.patch
6fd09454122fab34cb3d9ad37a13257ea4dd9a94ee15e057e276dba767708bba89b612c44033d3d1f854f348e3648e366b4c0e6421b04ca7f4891e34237928d1  move-string-macro.patch
a48a9b1192a2122e3ff91d79ed2a6b42bd49ae9b38721784165df4cc8477fbb53c591f0a20c3ab58512e681c453547317ad142729d2db7578ec9089a33a6900a  ump-header-detection.patch
fbc9d9ee28ec2f34419a34c48fa5736e096daae56de35e91beea249758a4bd22af0bdbb0f1a5f9205b08aa1ea8d3abc9bf6e72df0031e08539b528f554633e28  fix-segfault-32bit.patch
"
